package cn.yy.pojo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Paybill entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "paybill", catalog = "phoneerp")
public class Paybill implements java.io.Serializable {

	// Fields

	private Integer payId;
	private Money money;
	private Emp emp;
	private Inmatirial inmatirial;
	private Fees fees;
	private Confirm confirm;
	private Bankacount bankacount;
	private Bonus bonus;
	private Provider provider;
	private Payment payment;
	private Date date;
	private Double payPrice;
	private Integer isConfirm;
	private String description;
	private Integer isUserProviderBonus;
	private Set<Providetotalrbill> providetotalrbills = new HashSet<Providetotalrbill>(
			0);

	// Constructors

	/** default constructor */
	public Paybill() {
	}

	/** minimal constructor */
	public Paybill(Money money, Emp emp, Fees fees, Confirm confirm,
			Bankacount bankacount, Bonus bonus, Provider provider,
			Payment payment, Date date, Double payPrice, Integer isConfirm,
			String description, Integer isUserProviderBonus) {
		this.money = money;
		this.emp = emp;
		this.fees = fees;
		this.confirm = confirm;
		this.bankacount = bankacount;
		this.bonus = bonus;
		this.provider = provider;
		this.payment = payment;
		this.date = date;
		this.payPrice = payPrice;
		this.isConfirm = isConfirm;
		this.description = description;
		this.isUserProviderBonus = isUserProviderBonus;
	}

	/** full constructor */
	public Paybill(Money money, Emp emp, Inmatirial inmatirial, Fees fees,
			Confirm confirm, Bankacount bankacount, Bonus bonus,
			Provider provider, Payment payment, Date date, Double payPrice,
			Integer isConfirm, String description, Integer isUserProviderBonus,
			Set<Providetotalrbill> providetotalrbills) {
		this.money = money;
		this.emp = emp;
		this.inmatirial = inmatirial;
		this.fees = fees;
		this.confirm = confirm;
		this.bankacount = bankacount;
		this.bonus = bonus;
		this.provider = provider;
		this.payment = payment;
		this.date = date;
		this.payPrice = payPrice;
		this.isConfirm = isConfirm;
		this.description = description;
		this.isUserProviderBonus = isUserProviderBonus;
		this.providetotalrbills = providetotalrbills;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "payId", unique = true, nullable = false)
	public Integer getPayId() {
		return this.payId;
	}

	public void setPayId(Integer payId) {
		this.payId = payId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "moneyId", nullable = false)
	public Money getMoney() {
		return this.money;
	}

	public void setMoney(Money money) {
		this.money = money;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "empId", nullable = false)
	public Emp getEmp() {
		return this.emp;
	}

	public void setEmp(Emp emp) {
		this.emp = emp;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "inmatirialId")
	public Inmatirial getInmatirial() {
		return this.inmatirial;
	}

	public void setInmatirial(Inmatirial inmatirial) {
		this.inmatirial = inmatirial;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "feesId", nullable = false)
	public Fees getFees() {
		return this.fees;
	}

	public void setFees(Fees fees) {
		this.fees = fees;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "confirmID", nullable = false)
	public Confirm getConfirm() {
		return this.confirm;
	}

	public void setConfirm(Confirm confirm) {
		this.confirm = confirm;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "bankAcountId", nullable = false)
	public Bankacount getBankacount() {
		return this.bankacount;
	}

	public void setBankacount(Bankacount bankacount) {
		this.bankacount = bankacount;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "providerBonusId", nullable = false)
	public Bonus getBonus() {
		return this.bonus;
	}

	public void setBonus(Bonus bonus) {
		this.bonus = bonus;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "providerId", nullable = false)
	public Provider getProvider() {
		return this.provider;
	}

	public void setProvider(Provider provider) {
		this.provider = provider;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "paymentId", nullable = false)
	public Payment getPayment() {
		return this.payment;
	}

	public void setPayment(Payment payment) {
		this.payment = payment;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "date", nullable = false, length = 10)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "payPrice", nullable = false, precision = 22, scale = 0)
	public Double getPayPrice() {
		return this.payPrice;
	}

	public void setPayPrice(Double payPrice) {
		this.payPrice = payPrice;
	}

	@Column(name = "isConfirm", nullable = false)
	public Integer getIsConfirm() {
		return this.isConfirm;
	}

	public void setIsConfirm(Integer isConfirm) {
		this.isConfirm = isConfirm;
	}

	@Column(name = "description", nullable = false, length = 30)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "isUserProviderBonus", nullable = false)
	public Integer getIsUserProviderBonus() {
		return this.isUserProviderBonus;
	}

	public void setIsUserProviderBonus(Integer isUserProviderBonus) {
		this.isUserProviderBonus = isUserProviderBonus;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "paybill")
	public Set<Providetotalrbill> getProvidetotalrbills() {
		return this.providetotalrbills;
	}

	public void setProvidetotalrbills(Set<Providetotalrbill> providetotalrbills) {
		this.providetotalrbills = providetotalrbills;
	}

}